//
//  TabBarController.m
//  FreeTrip
//
//  Created by 邓芮 on 15/11/23.
//  Copyright © 2015年 邓芮. All rights reserved.
//

#import "TabBarController.h"
#import "NavigationController.h"
#import "InlandController.h"
#import "LogController.h"
@interface TabBarController ()

@end

@implementation TabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    NavigationController *inlandNav = [[NavigationController alloc]initWithRootViewController:[[InlandController alloc] init]];
    inlandNav.tabBarItem.title = @"景点";
    [inlandNav.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor redColor]} forState:UIControlStateSelected];
    [inlandNav.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor blackColor]} forState:UIControlStateNormal];
    inlandNav.tabBarItem.image = [[UIImage imageNamed:@"tabBar"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    inlandNav.tabBarItem.selectedImage = [[UIImage imageNamed:@"tabBarJ"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    NavigationController *LogNav = [[NavigationController alloc]initWithRootViewController:[[LogController alloc] init]];
    LogNav.tabBarItem.title = @"驴友日志";
    [LogNav.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor redColor]} forState:UIControlStateSelected];
    [LogNav.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor blackColor]} forState:UIControlStateNormal];
    LogNav.tabBarItem.image = [[UIImage imageNamed:@"tabBarR" ] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    LogNav.tabBarItem.selectedImage = [[UIImage imageNamed:@"tabBarRR" ] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    [self addChildViewController:inlandNav];
    [self addChildViewController:LogNav];
    
     [[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:23 / 255.0 green:177 / 255.0 blue:190 / 255.0 alpha:1]];
    
    [self.tabBar setTintColor:[UIColor blackColor]];
    
    UIView *back = [[UIView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, 49)];
    back.backgroundColor = [UIColor colorWithRed:23 / 255.0 green:177 / 255.0 blue:190 / 255.0 alpha:1];
    [self.tabBar insertSubview:back atIndex:0];
    self.tabBar.opaque = YES;
    
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
